package ltd.trackan.common.model.entity;

/**
 * 自定义错误码
 * @author wxa
 */
public enum StatusCode {
    SUCCESS(200, "成功"),
    FAILURE(400, "失败"),
    NOT_LOGIN_ERROR(401, "未登录"),
    FORBIDDEN_ERROR(403, "拒绝访问"),
    NOT_FOUND_ERROR(404, "请求数据不存在"),
    LIMIT_RATE_ERROR(429, "请求过于频繁"),
    NO_AUTH_ERROR(409, "无权限"),
    SYSTEM_ERROR(500, "系统内部异常"),
    PARAMETER_ERROR(40000, "参数错误"),
    USER_NOT_FOUND(40001, "用户不存在");
    // 限制流量
    


    /**
     * 状态码
     */
    private final int code;

    /**
     * 信息
     */
    private final String msg;

    StatusCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

}
